package br.com.guiav6.sisguia.utils;

import java.util.Locale;
import java.util.ResourceBundle;

public class MessagesUtil {

	private static Locale ptBR = new Locale("pt", "BR");
	private static ResourceBundle bundleWeb = ResourceBundle.getBundle("messages",	ptBR);
	private static ResourceBundle bundleEnum = ResourceBundle.getBundle("msgEnum", ptBR);

	public static String getMessage(String key) {
		try{
			return bundleWeb.getString(key);
		}catch (RuntimeException e) {
			return key;
		}
	}
	
	public static String getMessageEnum(String key) {
        try{
            return bundleEnum.getString(key);
        }catch (RuntimeException e) {
            return key;
        }
    }
	
}